package com.moriarty.socketim.util;


import android.os.Handler;

/**
 * Created by Moriarty on 16/11/16.
 */

public class ThreadUtil {

    //主要优点：无论主线程还是子线程 都写到run方法里面去 不用费心去分了
    public static void runOnSubThread(Runnable runnable) {
        new Thread(runnable).start();
    }

    private static Handler handler = new Handler();

    public static void runOnUIThread(Runnable runnable) {
        handler.post(runnable);
    }


}
